<?php namespace Cribbb\Storage\Category;
 
use Category;
 
class EloquentCategoryRepository implements CategoryRepository {
 
	/**
	 * Retrieving All Models
	 */
	public function all()
	{
		return Category::all();
	}
	
	/**
	 * Retrieving A Record By Primary Key
	 */
 	public function find($id)
 	{
 		return Category::find($id);
 	}
	
 	public function create($input)
 	{
 		return Category::create($input);
 	}
	
	public function update($id, $input)
	{
		$category = $this->find($id);
		$category->update($input);
	
		return $category;
	}
	
	public function delete($id)
	{
		$category = $this->find($id);
	
		return $category->delete();
	}
}